package user;


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.util.Scanner;

import org.omg.CORBA.ORB;

public class AdministratorClient extends Thread{

	
    public static void main(String args[]) throws RemoteException, NotBoundException, IOException{
    	ORB orb = ORB.init(args,null);
		
		BufferedReader br1 = new BufferedReader(new FileReader("ior1.txt"));
		String ior1 = br1.readLine();
		br1.close();
		
		org.omg.CORBA.Object o1 = orb.string_to_object(ior1);
		corbainterface FrontE = corbainterfaceHelper.narrow(o1);

		  @SuppressWarnings("resource")
			Scanner scanner = new Scanner(System.in);
                 
                  
                  System.out.println("Enter 3 for Getting Player Status:");
                  System.out.println("Enter 5 for Suspending User:");
                 
                  String x = scanner.next();
                  
                  	
                  	if(x.equals("3")){
                  		System.out.println("Enter username");
                        String User = scanner.next();
                        System.out.println("Enter Password");
                        String Pass = scanner.next() ;
                  		System.out.println("Enter IP address");
                        String IP = scanner.next();
                    
                      FrontE.getPlayerStatus(User, Pass, IP);
                  	}
                  	
                  	else if(x.equals("5")){
                  		System.out.println("Enter username");
                        String User1 = scanner.next();
                        System.out.println("Enter Password");
                        String Pass1 = scanner.next() ;
                  		System.out.println("Enter IP address");
                          String IP1 = scanner.next();
                          System.out.println("Enter Username to Suspend");
                          String Suspend = scanner.next();
                         
                              FrontE.suspendAccount(User1, Pass1, IP1, Suspend);
                          
                  	}
                  	
                  	else {System.out.println("Wrong Input!");
                  } 
                 }
      }

